var ScanDirAssistant = function() {
};

ScanDirAssistant.prototype.run = function(future) {
	var args = this.controller.args;
	if(!args.path) {
		setError(future, "parameter path must be a string");
	} else {
		path.exists(args.path, function(exists) {
			if(exists) {
				fs.readdir(args.path, function(err, f) {
					if(err) {
						setError(future, "readdir returned an error");
					} else {
						future.result = {
							files:	f.sort()
						};
					}
				});
			} else {
				future.result = {
					files: []
				};
			}
		});
	}
};
